# SPDX-License-Identifier: GPL-2.0-or-later

CMD_VIA_GET_PROTOCOL_VERSION = 0x01
CMD_VIA_GET_KEYBOARD_VALUE = 0x02
CMD_VIA_SET_KEYBOARD_VALUE = 0x03
CMD_VIA_GET_KEYCODE = 0x04
CMD_VIA_SET_KEYCODE = 0x05
CMD_VIA_LIGHTING_SET_VALUE = 0x07
CMD_VIA_LIGHTING_GET_VALUE = 0x08
CMD_VIA_LIGHTING_SAVE = 0x09
CMD_VIA_MACRO_GET_COUNT = 0x0C
CMD_VIA_MACRO_GET_BUFFER_SIZE = 0x0D
CMD_VIA_MACRO_GET_BUFFER = 0x0E
CMD_VIA_MACRO_SET_BUFFER = 0x0F
CMD_VIA_GET_LAYER_COUNT = 0x11
CMD_VIA_KEYMAP_GET_BUFFER = 0x12
CMD_VIA_VIAL_PREFIX = 0xFE
VIA_LAYOUT_OPTIONS = 0x02
VIA_SWITCH_MATRIX_STATE = 0x03
QMK_BACKLIGHT_BRIGHTNESS = 0x09
QMK_BACKLIGHT_EFFECT = 0x0A
QMK_RGBLIGHT_BRIGHTNESS = 0x80
QMK_RGBLIGHT_EFFECT = 0x81
QMK_RGBLIGHT_EFFECT_SPEED = 0x82
QMK_RGBLIGHT_COLOR = 0x83
VIALRGB_GET_INFO = 0x40
VIALRGB_GET_MODE = 0x41
VIALRGB_GET_SUPPORTED = 0x42
VIALRGB_SET_MODE = 0x41
CMD_VIAL_GET_KEYBOARD_ID = 0x00
CMD_VIAL_GET_SIZE = 0x01
CMD_VIAL_GET_DEFINITION = 0x02
CMD_VIAL_GET_ENCODER = 0x03
CMD_VIAL_SET_ENCODER = 0x04
CMD_VIAL_GET_UNLOCK_STATUS = 0x05
CMD_VIAL_UNLOCK_START = 0x06
CMD_VIAL_UNLOCK_POLL = 0x07
CMD_VIAL_LOCK = 0x08
CMD_VIAL_QMK_SETTINGS_QUERY = 0x09
CMD_VIAL_QMK_SETTINGS_GET = 0x0A
CMD_VIAL_QMK_SETTINGS_SET = 0x0B
CMD_VIAL_QMK_SETTINGS_RESET = 0x0C
CMD_VIAL_DYNAMIC_ENTRY_OP = 0x0D
DYNAMIC_VIAL_GET_NUMBER_OF_ENTRIES = 0x00
DYNAMIC_VIAL_TAP_DANCE_GET = 0x01
DYNAMIC_VIAL_TAP_DANCE_SET = 0x02
DYNAMIC_VIAL_COMBO_GET = 0x03
DYNAMIC_VIAL_COMBO_SET = 0x04
DYNAMIC_VIAL_KEY_OVERRIDE_GET = 0x05
DYNAMIC_VIAL_KEY_OVERRIDE_SET = 0x06
DYNAMIC_VIAL_ALT_REPEAT_KEY_GET = 0x07
DYNAMIC_VIAL_ALT_REPEAT_KEY_SET = 0x08

# how much of a macro/keymap buffer we can read/write per packet
BUFFER_FETCH_CHUNK = 28

# When did we get support for advanced macros (including delays in macros)
VIAL_PROTOCOL_ADVANCED_MACROS = 2
# Support for safe matrix tester (with unlock)
VIAL_PROTOCOL_MATRIX_TESTER = 3
# When did we get support for dynamic entries (tap dance, combos)
VIAL_PROTOCOL_DYNAMIC = 4
# When did we get support for qmk settings
VIAL_PROTOCOL_QMK_SETTINGS = 4
# When did we get support for 2-byte macros
VIAL_PROTOCOL_EXT_MACROS = 5
VIAL_PROTOCOL_KEY_OVERRIDE = 5
